package com.ruantu.clothing.dao;

import com.ruantu.clothing.entity.Rukuson;
import com.ruantu.clothing.entity.SelectStoreResult;
import com.ruantu.clothing.entity.Store;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface StoreMapper {

    /**
     * 根据jgid和产品id查询是否存在该商品
     *
     * @param map
     * @return
     */
    int findStoreByJgIdAndProductionDetailsId(Map<String, Object> map);

    int selectStoreSFCZ(Map<String, Object> map);//

    /**
     * 批量新增库存表
     *
     * @return
     */
    int insertStoreSome(List<Store> list);

    /**
     * 批量插入次品表
     *
     * @return
     */
    int insertStoreCipin(List<Store> list);

    /**
     * 批量更新
     *
     * @param
     * @return
     */
    int updateShuliang(List<Store> store);

    /**
     * 查询库存
     *
     * @return
     */
    List<Store> findStores(Map<String, Object> map);

    /**
     * 查询库存条数
     *
     * @param map
     * @return
     */
    int findStoresCount(Map<String, Object> map);


    /**
     * 库存-查询库存
     *
     * @param jgid
     * @param selectText
     * @param leiXing
     * @param shuLiang
     * @param ordTJ
     * @return
     */
    List<SelectStoreResult> selectStoreByTJ(@Param("jgid") String jgid,
                                            @Param("selectText") String selectText,
                                            @Param("leiXing") Integer leiXing,
                                            @Param("shuLiang") Integer shuLiang,
                                            @Param("cpYear") String cpYear,
                                            @Param("season") String season,
                                            @Param("pinpai") String pinpai,
                                            @Param("ordTJ") Integer ordTJ,
                                            @Param("start") Integer start,
                                            @Param("rows") Integer rows);

    /**
     * 库存数
     *
     * @param jgid
     * @param selectText
     * @param leiXing
     * @param shuLiang
     * @return
     */
    Integer selectStoreByTJCount(@Param("jgid") String jgid,
                                 @Param("selectText") String selectText,
                                 @Param("leiXing") Integer leiXing,
                                 @Param("shuLiang") Integer shuLiang,
                                 @Param("cpYear") String cpYear,
                                 @Param("season") String season,
                                 @Param("pinpai") String pinpai,
                                 @Param("ordTJ") Integer ordTJ);
}